import './plugins/axios'
import {createApp} from 'vue'
import App from './App.vue'
import router from './router'
import axios from '@/plugins/axios'
import config from '@/config/config'
import "@/assets/index.css"
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import VueMarkdownEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
import createEmojiPlugin from '@kangc/v-md-editor/lib/plugins/emoji/index';
import '@kangc/v-md-editor/lib/plugins/emoji/emoji.css';
import Prism from 'prismjs';

VueMarkdownEditor.use(vuepressTheme, {
   Prism,
});
VueMarkdownEditor.use(createEmojiPlugin());

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.provide('$baseURL',config.baseUrl.slice(0,-5)+':8200/')
const graphCodeUrl = process.env.NODE_ENV !== 'development' ?'/api/':'http://localhost:8200/api/'
app.provide('$axios', axios)
app.provide('$graph',graphCodeUrl)
app.use(VueMarkdownEditor);


app.use(router).mount('#app')
